angular.module('starter.services', [])

.factory('museumFac', function ($resource,cfg) {
  // Service logic
  // ...

  var meaningOfLife = 42;

  // Public API here
  return {
    ticket: $resource(cfg.baseUrl + 'api/ticket/:action', {}, {
      'tickets': {method:'GET', params:{action:'tickets'},isArray:false},
      'ticket': {method:'GET', params:{action:'ticket'},isArray:false},
      'confirmtorder': {method:'POST', params:{action:'confirmtorder'},isArray:false},
      'cancelticketorder': {method:'POST', params:{action:'cancelticketorder'},isArray:false},
      'redeemcodes': {method:'GET', params:{action:'redeemcodes'},isArray:false},
      'allredeemcodes': {method:'GET', params:{action:'allredeemcodes'},isArray:false}
    }),
    order: $resource(cfg.baseUrl + 'api/order/:action', {}, {
      'ticketorders': {method:'GET', params:{action:'ticketorders'},isArray:false},
      'ticketorderdetail': {method:'GET', params:{action:'ticketorderdetail'},isArray:false},
      'viptypes': {method:'GET', params:{action:'viptypes'},isArray:false},
      'viptype': {method:'GET', params:{action:'viptype'},isArray:false}
    }),
    info: $resource(cfg.baseUrl + 'api/info/:action', {}, {
      'exhibitions': {method:'GET', params:{action:'exhibitions'},isArray:false},
      'exhibitiondetail': {method:'GET', params:{action:'exhibitiondetail'},isArray:false},
      'works': {method:'GET', params:{action:'works'},isArray:false},
      'workdetail': {method:'GET', params:{action:'workdetail'},isArray:false},
      'indexbanner': {method:'GET', params:{action:'indexbanner'},isArray:false}
    }),
    wechat: $resource(cfg.baseUrl + 'api/wechat/:action', {}, {
      'confirmtorder': {method:'POST', params:{action:'confirmtorder'},isArray:false},
      'productpay': {method:'POST', params:{action:'productpay'},isArray:false},
      'addtowallet': {method:'POST', params:{action:'addtowallet'},isArray:false},
      'editwechatcard': {method:'POST', params:{action:'editwechatcard'},isArray:false},
      'accesstoken': {method:'GET', params:{action:'accesstoken'},isArray:false},
      'vippay': {method:'POST', params:{action:'vippay'},isArray:false},
      'wxgetticket': {method:'GET', params:{action:'wxgetticket'},isArray:false},
      'deletecwxcard': {method:'GET', params:{action:'deletecwxcard'},isArray:false},
      'wxcardtestid': {method:'GET', params:{action:'wxcardtestid'},isArray:false},
      'addvipmember': {method:'GET', params:{action:'addvipmember'},isArray:false}
    }),
    user: $resource(cfg.baseUrl + 'api/user/:action', {}, {
      'sendtoken': {method:'GET', params:{action:'sendtoken'},isArray:false},
      'register': {method:'POST', params:{action:'register'},isArray:false},
      'codes': {method:'GET', params:{action:'codes'},isArray:false},
      'profile': {method:'GET', params:{action:'profile'},isArray:false},
      'usertest': {method:'GET', params:{action:'usertest'},isArray:false},
      'orders': {method:'GET', params:{action:'productorders'},isArray:false},
      'editprofile': {method:'POST', params:{action:'editprofile'},isArray:false},
      'logout': {method:'POST', params:{action:'logout'},isArray:false}
    }),
    homeindex: $resource(cfg.baseUrl + 'home/index/:action', {}, {
      'confirmtorder': {method:'POST', params:{action:'confirmtorder'},isArray:false}
    }),
    product: $resource(cfg.baseUrl + 'api/product/:action', {}, {
      'categories': {method:'GET', params:{action:'categories'},isArray:false},
      'products': {method:'GET', params:{action:'products'},isArray:false},
      'product': {method:'GET', params:{action:'product'},isArray:false},
      'addtocart': {method:'POST', params:{action:'addtocart'},isArray:false},
      'savetocart': {method:'POST', params:{action:'savetocart'},isArray:false},
      'mycart': {method:'POST', params:{action:'mycart'},isArray:false},
      'cities': {method:'GET', params:{action:'cities'},isArray:false},
      'addaddress': {method:'POST', params:{action:'addaddress'},isArray:false},
      'editaddress': {method:'POST', params:{action:'editaddress'},isArray:false},
      'deleteaddress': {method:'POST', params:{action:'deleteaddress'},isArray:false},
      'addresses': {method:'GET', params:{action:'addresses'},isArray:false},
      'addressdetail': {method:'GET', params:{action:'addressdetail'},isArray:false},
      'cart': {method:'POST', params:{action:'confirmproductorder'},isArray:false},
      'paydetail': {method:'GET', params:{action:'productorderdetail'},isArray:false},
      'cancelorder': {method:'POST', params:{action:'cancelorder'},isArray:false}
    }),
  };
});
